﻿// Copyright (c) 2009 Kjetil Eraker Samuelsen
// This source is subject to the Microsoft Public License.
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
// All other rights reserved.

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace Ksamuelsen.Office.Outlook {
    public class OutlookPropertyPagePanel : Panel {
        public OutlookPropertyPagePanel() {
        }

        protected override void OnPaintBackground(PaintEventArgs e) {
            base.OnPaintBackground(e);
            VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.Tab.Body.Normal);
            renderer.DrawBackground(e.Graphics, ClientRectangle);
        }

        protected override void OnControlAdded(ControlEventArgs e) {
            base.OnControlAdded(e);
            if ((e.Control is Label) || (e.Control is PictureBox) || (e.Control is CheckBox))
                e.Control.BackColor = Color.Transparent;
        }

    }
}
